#pragma once

#include <ti/devices/msp/peripherals/hw_gpio.h>
#include "ti_msp_dl_config.h"
#include "Bsp.h"

#define BSRRH  DOUTSET31_0
#define BSRRL  DOUTCLR31_0

// GPIO引脚位置定义（31个引脚）
#define PIN0                1<<0
#define PIN1                1<<1
#define PIN2                1<<2
#define PIN3                1<<3
#define PIN4                1<<4
#define PIN5                1<<5
#define PIN6                1<<6
#define PIN7                1<<7
#define PIN8                1<<8
#define PIN9                1<<9
#define PIN10               1<<10
#define PIN11               1<<11
#define PIN12               1<<12
#define PIN13               1<<13
#define PIN14               1<<14
#define PIN15               1<<15
#define PIN16               1<<16
#define PIN17               1<<17
#define PIN18               1<<18
#define PIN19               1<<19
#define PIN20               1<<20
#define PIN21               1<<21
#define PIN22               1<<22
#define PIN23               1<<23
#define PIN24               1<<24
#define PIN25               1<<25
#define PIN26               1<<26
#define PIN27               1<<27
#define PIN28               1<<28
#define PIN29               1<<29
#define PIN30               1<<30


static inline void GPIO_Set(GPIO_Regs* gpio, uint32_t pins, uint8_t status)
{
    if (status) {
        gpio->BSRRH = pins;
    } else {
        gpio->BSRRL = pins;
    }
}
